﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Sandbox.Serialization.StringSerializers
{
	public class ImageSerializer : StringSerializer
	{
		protected override object FromString(Type type, string str, GameLib.Serialization.DataFlags dataFlags)
		{
			Uri uri = new Uri(str, UriKind.Relative);
			BitmapImage image = new BitmapImage(uri);
			return image;
		}

		public override string ConvertToString(object obj, GameLib.Serialization.DataFlags dataFlags)
		{
			throw new NotImplementedException();
		}

		public override Type SupportedType
		{
			get { return typeof(ImageSource); }
		}
	}
}
